/* Copyright - Apache License 2.0
 * 
 * The project "kyou" is
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *      http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.kyou.data.dquery;

import net.kyou.data.SchemaItem;

/**
 * 最基础的DQuery，表示一个确定的DPath，不包含任何通配符和多数组下标。
 * <p>
 * 例：#.a.b[0].c
 * </p>
 * 
 * @author NuclearG (<a href="mailto:nuclearg@163.com">nuclearg@163.com</a>)
 */
class BasicDQuery extends DQuery {
    private final String query;

    BasicDQuery(String query) {
        this.query = query;
    }

    @Override
    public boolean matches(String path, SchemaItem schema) {
        // 简单地判断给定的路径是否与DQuery本身的路径完全相同
        return this.query.equals(path);
    }
}
